package com.java01.jdbc.statement;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class SimpleInsert {

	public static void main(String[] args) {
		insert();
	}

	public static void insert() {
		Statement stat = null;
		try {
			Class.forName("org.sqlite.JDBC");
			Connection conn = DriverManager.getConnection("jdbc:sqlite:books.db");
			stat = conn.createStatement();
			stat.executeUpdate("DROP TABLE IF EXISTS books;");
			stat.executeUpdate("CREATE TABLE books (isdn, name, number);");
			stat.executeUpdate("INSERT INTO books VALUES (12345, 'Thinking in Java', 200)");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
